﻿package frEngine.shader.md5shader
{
    import flash.display3D.*;
    import flash.events.*;
    import frEngine.core.*;
    import frEngine.shader.filters.*;
    import frEngine.shader.filters.fragmentFilters.*;
    import frEngine.shader.filters.vertexFilters.*;
    import frEngine.shader.registType.*;

    public class DepthShader extends Md5ShaderBase
    {
        private var _depthColorRg:FcParam;

        public function DepthShader(param1:int, param2:VertexFilter, param3:FragmentFilter)
        {
            super(param1, param2, param3);
            this.materialParams.setBlendMode(EBlendType.BLEND_ALPHA3);
            this.materialParams.depthCompare = Context3DCompareMode.LESS_EQUAL;
            return;
        }// end function

        override protected function materialRebuilder(event:Event) : void
        {
            super.materialRebuilder(event);
            this._depthColorRg = this.getParam(FilterName.COLOR, false);
            return;
        }// end function

        public function changeParams(param1:Number, param2:Number, param3:Number, param4:Number) : void
        {
            if (this._depthColorRg)
            {
                this._depthColorRg.changeValue4(param1, param2, param3, param4);
            }
            return;
        }// end function

    }
}
